<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const arr = [
        {id: 1, date: '2023-05-05 06:20:20'},
        {id: 2, date: '2023-05-05 06:23:20'},
        {id: 3, date: '2023-05-05 06:16:20'},
        {id: 4, date: '2023-05-18 03:20:20'},
        {id: 5, date: '2023-05-15 07:20:20'},
    ]

    let k = arr.sort((x, y) => new Date(y.date) - new Date(x.date))
    console.log(k)
</script>
</body>
</html>
